import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:vape_xe/routes/app_pages.dart';
import 'package:vape_xe/utils/utils.dart';
import 'package:vape_xe/values/values.dart';

import 'logic.dart';

class ChangeSuccessView extends GetView<ChangeSuccessController> {
  const ChangeSuccessView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new_rounded),
          onPressed: () => Get.offNamedUntil(Routes.ACCOUNTINFO, (route) => false),
        ),
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Text(
              'Modified successfully!'.tr,
              style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.bold),
            ),
            4.hGap,
            Obx(
              () => Text(
                controller.arguments['type'] == 1
                    ? 'Bundled mobile phone +${controller.arguments['mobileType']} ${controller.arguments['mobile']}'.tr
                    : 'Bundled email ${controller.arguments['email']}',
                style: TextStyle(fontSize: 12.sp, color: AppColors.thirdText),
              ),
            ),
            36.hGap,
            GestureDetector(
              onTap: () => Get.offNamedUntil(Routes.ACCOUNTINFO, (route) => false),
              child: Container(
                height: 52.h,
                margin: EdgeInsets.symmetric(horizontal: 32.w),
                decoration: BoxDecoration(
                  gradient: const LinearGradient(colors: [Color(0xff6EDEF7), Color(0xff3351EF)]),
                  borderRadius: 100.radius,
                ),
                child: Center(
                  child: Text(
                    'Confirm'.tr,
                    style: const TextStyle(fontFamily: 'Montserrat', fontWeight: FontWeight.bold),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
